/**
 * @author Matthew.He
 */
package org.dragonnova.business.modules.sys.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.dragonnova.business.modules.enterprise.entity.Department;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
public class User implements Serializable {

	/**
	 * 
	 */
	public static final long serialVersionUID = -8487729891897203929L;

	private Long id;
	private String name;
	private Date creDt = new Date();
	private String recStat = "0";
	private String remark;
	private String sex;
	private String phone;
	private String password;
	private Department department;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "cre_dt", nullable = false)
	public Date getCreDt() {
		return creDt;
	}

	public void setCreDt(Date creDt) {
		this.creDt = creDt;
	}

	@Column(name = "remark", nullable = true)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "sex")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "phone")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	// @Column(name="depart_id")
	// public int getDepart_id() {
	// return depart_id;
	// }
	// public void setDepart_id(int depart_id) {
	// this.depart_id = depart_id;
	// }

	@ManyToOne
	@JoinColumn(name = "depart_id", nullable = true)
	@NotFound(action = NotFoundAction.IGNORE)
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "rec_stat")
	public String getRecStat() {
		return recStat;
	}

	public void setRecStat(String recStat) {
		this.recStat = recStat;
	}

	@Column(name = "password", nullable = false)
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
